Repository navigation
Conversation
|
@Ericko00o #256 merged on 2026-10-11, so the prerequisite this draft waits on is in |
ff67108 to
3bef5c8
Compare
jserv
left a comment
There was a problem hiding this comment.
Rebase latest main branch and resolve conflicts.
An unfinished interview should retain the draw and lobby choices taken when Start was pressed, even when sign-in delays navigation. Restore those choices across Back, Leave, and Done without letting later edits replace the ticket. Only the latest successfully saved graded report may end a draw; retained older reports cannot prove completion after a failed save. Clearing a topic returns to recommendations.
3bef5c8 to
edecbee
Compare
ColtenOuO
left a comment
There was a problem hiding this comment.
Supporting the case where sessionStorage is unavailable brings in a number of extra problems to solve, and handling them is a large part of why this PR has to change so many places.
That case should also be fairly rare.
Would it be better to simply not keep the draw and fall back to recommendations when sessionStorage is unavailable?
As a design trade-off, I think taking on this much extra code to cover that one case will make the feature harder to maintain.
| // Same-origin receipts distinguish the current save from retained older rows. | ||
| // Ticket-specific keys keep concurrent tabs from replacing each other's result. | ||
| function readSaveOutcome(draw) { | ||
| try { | ||
| const area = globalThis.localStorage; | ||
| const value = area.getItem(outcomeKey(draw)); | ||
| if (!value) return null; | ||
| // Read-only storage cannot prove that a later failure invalidated this row. | ||
| area.setItem(outcomeKey(draw), value); | ||
| const outcome = JSON.parse(value); | ||
| if (outcome.id !== draw.id || outcome.problemId !== draw.problemId) | ||
| return null; | ||
| outcomeDraw = draw; | ||
| return outcome; | ||
| } catch { | ||
| return null; | ||
| } | ||
| } |
There was a problem hiding this comment.
That would also remove the localStorage receipts entirely, along with the cross-tab and read-only checks they need.
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
Rebase latest |
|
Thank you, @ColtenOuO. Your point about the maintenance cost helped me reconsider whether this feature is worth adding at all. Preserving a random draw across interview navigation is a small convenience. Returning to the normal recommendations still leaves the core interview flow usable. Even with the sessionStorage-only approach, the additional state and lifecycle handling seem disproportionate to the benefit. I have decided to close this PR for now rather than ask the maintainers to spend more time reviewing and maintaining it.. If user feedback later shows a clear need for preserving draws, we can revisit it with a smaller design. Thanks to you and the other reviewers for the thoughtful feedback and time spent on this PR. |
Preserve an explicit random draw and the candidate's difficulty and duration choices when returning from an unfinished interview through Back, Leave, or Done. Capture the draw ticket and lobby snapshot when Start is pressed so picker changes during an awaited sign-in cannot replace the interview's selection. Reapply the captured choices after native browser form restoration. Clearing a topic filter returns to recommendations while retaining the explicit lobby choices.
Save a tab-local snapshot alongside the draw ticket for fresh lobby entries. Only the latest successfully persisted graded HIRE or NO_HIRE report may end that draw. Beginning a new save invalidates previous completion, so pending, rejected, and failed saves cannot reuse a retained older report. Interview URLs without a ticket cannot claim another draw, and unrelated report deletion or account-history merges retain the selection.
When sessionStorage is unavailable, a ticket-specific same-origin localStorage receipt records the current save outcome and must match the persisted report. Receipts from another tab cannot replace this draw's result. Read-only storage cannot establish a current completion and is treated conservatively. Browser Back uses history state when tab storage is blocked; a fresh lobby entry requires available tab storage to restore the snapshot. If neither completion store is usable, retain the draw instead of inferring success from old history.
Validation: all 237 targeted picker, lobby, draw-completion, and interview-lifecycle tests passed without failures or skips. The login-race and newer-failed-save cases failed before the fixes and passed afterward. Formatting, ESLint, commit-message validation, staged checks, and all 49 Git hooks checks passed. The full browser suite reported 1192 passed, 5 failed, and 3 skipped. The required scripts/test.sh gate was run but did not pass: Cargo was unavailable; wire-fixtures and recording-provision-check-tests encountered existing Windows limitations; the five browser failures were four Windows ESM path cases and one unavailable-server face check. Java and two built-server browser cases were skipped, and cargo-audit, actionlint, ruff, and shellcheck were unavailable.
Rebased onto main at 8394d54. This PR contains one navigation commit and preserves upstream source-display, interview retry settings, and voice controls.